package com.coolwen.spring.speciality.model;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author CoolWen
 * @version 2020-04-09 8:46
 */
@Component
public class User {

//    @Autowired
//    private ConfigurableEnvironment env;
    //    @Value("${user.username}")
    private String username;
    //    @Value("${user.nickname}")
    private String nickname;

    public User(String username, String nickname) {
        this.username = username;
        this.nickname = nickname;
    }

//    @PostConstruct
//    public void init() {
//        this.username = env.getProperty("user.username");
//        this.nickname = env.getProperty("user.nickname");
//    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
}
